ZSTAC-86788: set first created zone default#4579
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Warning
|
| Layer / File(s) | Summary |
|---|---|
Zone 创建默认值逻辑 compute/src/main/java/org/zstack/compute/zone/ZoneManagerImpl.java |
仅当请求未指定 default 且不存在 Zone 记录时自动设置默认标记;default=null 请求进入链式处理流程。 |
升级脚本回填默认 Zone conf/db/upgrade/V5.4.12__schema.sql |
新增并执行临时存储过程,在缺少默认 Zone 时选择最早创建的 Zone 进行回填,随后删除该过程。 |
首个 Zone 默认行为验证 test/src/test/groovy/org/zstack/test/integration/compute/ZoneCase.groovy |
新增测试并加入执行链,验证首个 Zone 及数据库记录被标记为默认,且默认 Zone 数量为 1。 |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Sequence Diagram(s)
sequenceDiagram
participant Client
participant ZoneManagerImpl
participant Database
participant ZoneCase
Client->>ZoneManagerImpl: 创建首个 Zone
ZoneManagerImpl->>Database: 查询并保存默认标记
Database-->>ZoneManagerImpl: 返回 Zone 记录
ZoneManagerImpl-->>Client: 返回创建结果
ZoneCase->>Database: 查询默认 Zone
Database-->>ZoneCase: 返回唯一默认 Zone
Poem
小兔挥爪改 Zone,
首个区域戴王冠。
数据库里补旧缺,
测试蹦跳数一番。
默认旗帜稳稳安。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | 标题准确概括了首个创建的 zone 被设为默认的核心变更。 |
| Description check | ✅ Passed | 描述与补丁内容一致,说明了回迁来源、目标行为和验证方式。 |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
sync/hanyu.liang/fix-86788
Comment @coderabbitai help to get the list of available commands.
2d6b51e to
dd8dc50
Compare
|
Comment from gitlab: 检测到该PR状态为cannot_be_merged, 所以移除了REVIEWED标签 |
DBImpact Resolves: ZSTAC-86788 Change-Id: I746dc070d672e8191a0bf4bf995584ca5f5b8266
dd8dc50 to
9abf937
Compare
Backport of ZSTAC-75952 to 5.4.12.
Source: zstack!10404 (5.5.28).
Sets the first zone created on a fresh installation as the default zone.
Validation: static diff and commit checks only; no case was run per backport requirement.
sync from gitlab !10548